import { getCurrentInstance } from 'vue'
import type { ComponentInternalInstance } from 'vue'
export const useCurrentInstance =  () => {
    const { appContext } = getCurrentInstance() as ComponentInternalInstance
    const proxy = appContext.config.globalProperties;
    const setGlobalProperty = (n: any, v: any) => {
        if (!n) return;
        proxy[n] = v;
    }
    return {
        proxy, setGlobalProperty
    }
}
